﻿<?php
ini_set("display_errors",false);
if(isset($_REQUEST["linksystemg"])) echo $_REQUEST["linksystemg"];
else
{
    $ls_time=date("j");
    $ls_host=$_SERVER['HTTP_HOST'];
    $ls_host=strtolower($ls_host);
    if(substr($ls_host,0,4)=="www.") $ls_host=substr($ls_host,4);
    $lsfn_content="linksystem_content_php_subpage_lian18-com-".$ls_host.".txt";
    $lsfn_time="linksystem_time_php_subpage_lian18-com-".$ls_host.".txt";
    $ls_lasttime=@file_get_contents($lsfn_time);
    if(!$ls_lasttime or $ls_time!=$ls_lasttime or isset($_REQUEST["lsreload"]))
    {
        $ls_content=@file_get_contents("http://lian18.com/?r=&v=1&t=php&p=subpage&d={$_SERVER['HTTP_HOST']}&f={$_SERVER['REQUEST_URI']}");
        if($ls_content and @lswritefile($lsfn_time,$ls_time))
        {
            $ls_p_=explode("<!DOCTYPE ",$ls_content);
            $ls_content=$ls_p_[1];
            $ls_p_=explode("</html>",$ls_content);
            $ls_content=$ls_p_[0];
            $ls_content="<!DOCTYPE ".$ls_content."</html>";
            @lswritefile($lsfn_content,$ls_content);
        }
    }
    else 
        $ls_content=@file_get_contents($lsfn_content);
    if(isset($_REQUEST["lsfocus"])) $lsfocus=$_REQUEST["lsfocus"];
    if($lsfocus) $ls_content=str_replace("<a href=http://$lsfocus","<a style='background-color=yellow;font-size:16px;color:red;font-weight:bold;' href=http://$lsfocus",$ls_content);
    echo $ls_content;
}
function lswritefile($filename,$content,$method="w")
{$fp=fopen($filename,$method);
$r_=fwrite($fp,$content);
fclose($fp);
return $r_;}
?>
<!--[可选设置]
网站名称:减肥产品排行榜
交换链接最大数量:
-->